<template>
  <!--  -->
  <template v-if="item.children && item.children.length">
    <el-table-column :label="item.title">
      <tt-table-column
        v-for="(self, current) in item.children"
        :key="current"
        :item="self"
      ></tt-table-column>
    </el-table-column>
  </template>
  <template v-else>
    <el-table-column
      :prop="item.key"
      :label="item.title"
      :fixed="item.fixed"
      :width="item.width"
    >
      <template #default="scope">
        <ttTableItem
          :row="scope.row"
          :rowIndex="scope.$index"
          :item="item"
        ></ttTableItem>
      </template>
    </el-table-column>
  </template>
</template>

<script setup>
import ttTableItem from "./tt-table-item.vue";

const props = defineProps({
  item: {},
});
</script>
<style lang="scss" scoped></style>
